package com.cw.controller;


import com.cw.common.api.*;
import com.cw.request.*;
import com.cw.service.*;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.*;
import org.springframework.web.bind.annotation.*;

/**
 * @author smq
 * @since 2021-05-05
 */
@Api(tags = {"科室"})
@RestController
@RequestMapping("/his-cwgl-dept")

public class HisCwglDeptController {

    @Autowired
    private IHisCwglDeptService targetService;



    @ApiOperation(value = "获取科室列表")
    @PostMapping("/getDeptList")
    public ResultObject getDeptList(@RequestBody EmptyBedsRequest emptyBedsRequest) {
        return ResultObject.successReturn(targetService.getDeptList(emptyBedsRequest));
    }

    @ApiOperation(value = "获取科室列表")
    @GetMapping("/getDeptListByYard")
    public ResultObject getDeptListByYard(@RequestParam String yard) {
        return ResultObject.successReturn(targetService.getDeptListByYard(yard));
    }


    @ApiOperation(value = "获取全部科室列表")
    @PostMapping("/getAllDeptList")
    public ResultObject getAllDeptList(@RequestBody EmptyBedsRequest emptyBedsRequest) {
        return ResultObject.successReturn(targetService.getAllDeptList(emptyBedsRequest));
    }

    @ApiOperation("通过科室主键获取病区集合")
    @GetMapping("/getPatientAreaDTO")
    public ResultObject getPatientAreaDTO(@RequestParam(required = false) String deptCode,String areaCode,String yard) {
        return ResultObject.successReturn(targetService.getPatientAreaDTO(deptCode, areaCode,yard));
    }

    @ApiOperation(value = "获取科室列表His")
    @PostMapping("/getDeptListHis")
    public ResultObject getDeptListHis(@RequestBody EmptyBedsRequest emptyBedsRequest) {
        return ResultObject.successReturn(targetService.getDeptList(emptyBedsRequest));
    }

    @ApiOperation(value = "通过病区编码获取科室信息")
    @GetMapping("/getHisCwglDeptByAreaCode")
    public ResultObject getHisCwglDeptByAreaCode(@RequestParam String areaCode,String yard) {
        return ResultObject.successReturn(targetService.getHisCwglDeptByAreaCode(areaCode,yard));
    }
}

